import { request } from 'umi';

export async function getTypeCount(options?: { [key: string]: any }) {
    return request<{
        data: any[];
    }>('/mockApi/typeCount', {
        method: 'GET',
        ...(options || {}),
    });
}

export async function getTypes1(options?: { [key: string]: any }) {
    return request<{
        data: any[];
    }>('/mockApi/types1', {
        method: 'GET',
        ...(options || {}),
    });
}

export async function getTypes2(options?: { [key: string]: any }) {
    return request<{
        data: any[];
    }>('/mockApi/types2', {
        method: 'GET',
        ...(options || {}),
    });
}

export async function queryKnowledge(filter: any, options?: { [key: string]: any }) {
    return request<{
        data: any[];
    }>('/mockApi/getKnowledge', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
        },
        data: filter,
        ...(options || {}),
    });
}


//根据知识类型分组统计
export async function GetroupStatisticsByKnowledgeTypeRequest(
    options?: {[key: string]: any;
    }){
    return request<AircasKB.ResponseType<AircasHome.GetroupStatisticsByKnowledgeTypeResponse[]>>(
        `/aircaskb/public/index/groupStatisticsByKnowledgeType`,
        {
            method:"GET",
            ...(options || {}),});
}

//首页广告栏
export async function GetindexBannerListRequest(
    options?: {[key: string]: any;
    }){
    return request<AircasKB.ResponseType<AircasHome.GetindexBannerListResponse[]>>(
        `/aircaskb/indexBanner/list`,
        {
            method:"GET",
            ...(options || {}),});
}

//系统推荐列表
export async function GetRecommendationListRequest(
    options?: {[key: string]: any;
    }){
    return request<AircasKB.ResponseType<AircasHome.GetRecommendationListResponse[]>>(
        `/aircaskb/recommendation/list`,
        {
            method:"GET",
            ...(options || {}),});
}


//最新发布知识
export async function GetLatestKnowledgeRequest(
    options?: {[key: string]: any;
    }){
    return request<AircasKB.ResponseType<AircasHome.GetLatestKnowledgeResponse[]>>(
        `/aircaskb/public/index/latestKnowledge`,
        {
            method:"GET",
            ...(options || {}),});
}
